<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>

<body>
    <script>
        //创建
        let s = Symbol();
        let s2 = Symbol('pets')

        //Symbol 代表独一无二的
        let game = {
            //
        }
        let methods = {
            up: Symbol(),
            down: Symbol()
        }
        game[methods.up] = function () {
            console.log('我可以上升')
        }
        game[methods.down] = function () {
            console.log('我可以下降')
        }
        console.log(game)

        //控制元素是否展开

        const arr = [1, 2, 3]
        const arr2 = [4, 5, 6]
        //结果就是[1,2,3[4,5,6]], arr2不会被展开
        arr2[Symbol.isConcatSpreadable] = false
        console.log(arr.concat(arr2))
    </script>
</body>

</html>